#include "bird.h"
#include <QApplication>
#include <QDateTime>
#include <QPixmap>
#include <QSplashScreen>
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QPixmap pixmap(":/images/myimages/startpicture.jpg");     //读取图片
      QSplashScreen splash(pixmap); 
      splash.show();//展示图标
      splash.showMessage("程序正在加载......", Qt::AlignCenter, Qt::black);//显示游戏正在加载中字样
      QDateTime time = QDateTime::currentDateTime();
      QDateTime currentTime = QDateTime::currentDateTime(); //记录当前时间
      while (time.secsTo(currentTime) <= 2) // 2为需要延时的秒数
      {
        currentTime = QDateTime::currentDateTime();
        a.processEvents();
      };

    MainWindow w;
    w.show();
    splash.finish(&w);//在对象初始化之后startpicture图标消失

    return a.exec();
}